package stockscreener.util;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class StockScreenerApplicationContext {

	private static ApplicationContext ctx = new ClassPathXmlApplicationContext(
			"applicationContext-stockscreener.xml");

	private static ApplicationContext getApplicationContext() {
		return ctx;
	}

	public static Object getBean(Class clazz) {
		return getApplicationContext().getBean(clazz.getSimpleName());

	}

	public static Object getBean(String beanName) {
		return getApplicationContext().getBean(beanName);

	}
}
